package com.syq.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.syq.mapper.DtsGoodsSpecificationMapper;
import com.syq.pojo.DtsGoodsAttribute;
import com.syq.pojo.DtsGoodsSpecification;
import com.syq.service.DtsGoodsSpecificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @ClassName: DtsGoodsSpecificationServiceImpl
 * @Description: TODO
 * @Create by: syq
 * @Date: 2022/7/23 11:10
 */

@Service
@Transactional
public class DtsGoodsSpecificationServiceImpl implements DtsGoodsSpecificationService {
    @Autowired
    private DtsGoodsSpecificationMapper goodsSpecificationMapper;

    @Override
    public List<DtsGoodsSpecification> findById(Integer id) {
        return goodsSpecificationMapper.selectList(new QueryWrapper<DtsGoodsSpecification>().eq("goods_id",id));
    }

    @Override
    public void deleteById(Integer id) {
        goodsSpecificationMapper.delete(new QueryWrapper<DtsGoodsSpecification>().eq("goods_id",id));
    }

    @Override
    public void add(DtsGoodsSpecification specification) {
        goodsSpecificationMapper.insert(specification);
    }
}
